const MyPromise = require("../template.js")

/*** 五、异常捕获测试 */
function testExceptionHanding() {
  const promise = new MyPromise((_) => {
    throw new Error("error")
  })

  promise.then(
    (value) => console.log("5. Fulfilled:", false),
    (reason) => console.log("5.Rejected:", reason.message === "error") // 应输出 true
  )
}

testExceptionHanding()
